package com.lsfb.signsys.bootstrap;

import android.content.Intent;
import android.support.annotation.NonNull;

import com.lsfb.signsys.BaseActivity;
import com.lsfb.signsys.R;
import com.lsfb.signsys.login.LoginActivity;

import static com.google.common.base.Preconditions.checkNotNull;

//import static com.google.common.base.Preconditions.checkNotNull;


public class BootstarpActivtiy extends BaseActivity implements BootstrapContract.View {

    BootstrapPresenter bootstrapPresenter;


    BootstrapContract.Presenter mPersenter;



    @Override
    public void showMainActivity() {
        startActivity(new Intent(BootstarpActivtiy.this, LoginActivity.class));
        finish();
    }

    @Override
    public void setPresenter(@NonNull BootstrapContract.Presenter persenter) {
        this.mPersenter = checkNotNull(persenter);
    }


    @Override
    protected void onResume() {
        super.onResume();
        mPersenter.subscribe();
    }

    @Override
    protected void onPause() {
        super.onPause();
        mPersenter.unsubscribe();
    }

    @Override
    public int getContentView() {
        return R.layout.activity_bootstrap;
    }

    @Override
    public void init() {
        bootstrapPresenter = new BootstrapPresenter(this);
    }
}
